<form id="category_with_level_form" action="">
<div style="clear: both; width: 715px;">
       <?php foreach ($categories as $i => $category) {
       		?>
       		<div class="widget	" style="float: left; margin-right: 20px; clear: none; margin-top: 10px">
       			<div class="head"><h5 class="iList"><?php echo $category->getName();?></h5></div>
       			<?php 
       			$root_level = Doctrine_Core::getTable('Level')->getRootLevel($category->getId());
       			$the_table = Doctrine_Core::getTable('Level');
       			$the_table->setChildren();
       			$the_table->getCategoryChildrenList($root_level);
       			foreach ($the_table->getChildren() as $level) {
       				?>
       				<div style="padding: 5px;">
       					<?php $checked = $level->isMemberOfSelection($levelIds) ? "checked = 'checked'" : "" ?>
       					<input <?php echo $checked ?> type="checkbox" id="chbx_level_<?php echo $level->getId();?>" name="chbx_level_<?php echo $level->getId();?>"  /><span style="margin-left: 5px"> <?php echo $category->getName().".".$level->getName();?></span>
       				</div>
       				<?php 
       				if ($i % 4 == 0){
       					?>
       					<div style="clear: both;"></div>
       					<?php 
       				}
       			}?>
       		</div>
       		<?php 
       }?>         			 
</div>
</form>

<script>
$('form').jqTransform({imgPath:'../images/forms'});
</script> 